<template>
	<view class="page-index">
		<view class="imageMap" @click="goRent()">
			<view class="title">
				求租求购
			</view>
			<view class="content">
				求租求购信息
			</view>
		</view>
		<view class="imageMap1" @click="goBuy()">
			<view class="title">
				拨打电话
			</view>
			<view class="content">
				拨打平台电话
			</view>
		</view>
	</view>
</template>

<script>
	import * as index from '@/api/index.js'
	export default {
		data() {
			return {

			}
		},
		methods: {
			goRent() {
				this.$tools.navigate('/pages/home/rentHome/rentHome?type=' + 'rent')
			},
			goBuy() {
				index.getTel().then(res=>{
					let arr = res.data.split(',')
					uni.showActionSheet({
						itemList: arr,
						success: function (res) {
							uni.makePhoneCall({
								phoneNumber: arr[res.tapIndex] //仅为示例
							});
						},
						fail: function (res) {
							console.log(res.errMsg);
						}
					});

				})
				// uni.navigateToMiniProgram({
				// 	appId: 'wxdc1872c7cca4515a',
				// 	path: '',
				// 	extraData: {
				// 		'data1': 'release'
				// 	},
				// 	success(res) {
				// 		// 打开成功
				// 	}
				// })
				// uni.makePhoneCall({
				// 	phoneNumber: '19154506309' //仅为示例
				// });

			}
			// map(){
			// 	this.$Router.replaceAll({
			// 		name: 'MapSearch',
			// 	})
			// },
			// resume(){
			// 	uni.$emit('TabbarIndex',1)
			// }
		}
	}
</script>

<style scoped lang="scss">
	.page-index {
		// margin: 0 -12rpx;
		font-family: PingFang SC-Medium, PingFang SC;
		margin-top: 20rpx;
		// width: calc(100% - 30rpx);
		// padding: 0 20rpx;
		display: flex;
		justify-content: space-between;

		.imageMap {
			width: 340rpx;
			height: 126rpx;
			background: url(@/static/home/back2.png);
			background-repeat: no-repeat;
			background-size: 100% 100%;
			// padding: 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-around;

			.title {
				margin-left: 20rpx;
				font-size: 30rpx;
				font-weight: 700;
				color: #202020;
				line-height: 35rpx;
			}

			.content {
				margin-left: 20rpx;
				margin-top: -20rpx;
				font-size: 20rpx;
				color: #202020;
				line-height: 23rpx;
				opacity: 0.5;
			}
		}

		.imageMap1 {
			width: 340rpx;
			height: 126rpx;
			background: url(@/static/home/back1.png);
			background-repeat: no-repeat;
			background-size: 100% 100%;
			// padding: 20rpx;
			display: flex;
			flex-direction: column;
			justify-content: space-around;

			.title {
				margin-left: 20rpx;
				font-size: 30rpx;
				font-weight: 700;
				color: #202020;
				line-height: 35rpx;
			}

			.content {
				margin-left: 20rpx;
				margin-top: -20rpx;
				font-size: 20rpx;
				color: #202020;
				line-height: 23rpx;
				opacity: 0.5;
			}
		}
	}
</style>
